package com.xquant.trade.rocketmq;

import cn.hutool.json.JSONObject;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @desc:rocketmq
 * @auth:zes
 * @date 2022/5/12 1:06 上午
 **/
@Component
public class RocketMqProducer {

    @Autowired
    private RocketMQTemplate rocketmqtemplate;

    public void send(String topic, String msg) {
        rocketmqtemplate.convertAndSend(topic, msg);
    }

    public void send(String topic, JSONObject jsonObject)  {
        rocketmqtemplate.convertAndSend(topic, jsonObject);
    }


}
